package neuralNetworks.tool;

import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;

public class NNSaveFrame extends JFrame {
	private static final long serialVersionUID = 2058927078980360158L;

	public JButton saveButton = new JButton("Speichern");

	public ISaveable saveable;

	public String folder;

	public NNSaveFrame(ISaveable saveable) {
		super("NNSaveFrame");

		this.saveable = saveable;

		saveButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {
				save();
			}
		});
		this.setLayout(new FlowLayout());

		this.getContentPane().add(saveButton);
		this.setPreferredSize(new Dimension(300, 100));
		saveButton.setPreferredSize(new Dimension(120, 20));

		this.pack();
		this.setVisible(true);
	}

	public void save() {
		saveable.save();
	}

}
